package com.biostime.qdingding.modules.qd.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.biostime.qdingding.common.service.CrudService;
import com.biostime.qdingding.modules.qd.dao.PromotionDao;
import com.biostime.qdingding.modules.qd.entity.Promotion;

/**
 * 促销模版Service
 * @author king
 * @version 2015-11-12
 */
@Service
@Transactional(readOnly = true)
public class PromotionService extends CrudService<PromotionDao, Promotion> {
	@Autowired
	private PromotionDao promotionDao;
	
	@Override
	public List<Promotion> findList(Promotion entity) {
		dataScopeFilter(entity, "dsf", "id=a.center_id", "id=a.create_by");
		
		return super.findList(entity);
	}
	
	
	
	
//	<!-- ————————————————————————————楚河汉界，谁敢动我的，打死! ————————————————————————————————————-->	
	public List<HashMap<String,Object>> apiGetIdByStudent(String studentId){
		return promotionDao.apiGetIdByStudent(studentId);
	}
	
	public Promotion apiGetById(String id){
		return dao.apiGetById(id);
	}
}
